/**
 * 
 */
package com.block.common.security.service.factory;


import com.block.common.security.service.ReturnDataService;
import com.block.common.security.service.impl.returnData.DefaultRespTransferService;
import com.block.common.security.service.impl.returnData.XHYRespTransferService;
import com.block.common.util.ApplicationContextUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * 返回数据处理工厂
 */
public class ReturnDataFactory {

	private  static  final  String XHY="XHY";
	/**
	 * 【返回数据处理】MAP
	 */
	private static Map<String, Class<? extends ReturnDataService>> returnDataServiceMap = new HashMap<>();
	static 
	{
		returnDataServiceMap.put(XHY,XHYRespTransferService.class);
		
	}
	
	/**
	 * 获得【返回数据处理】
	 * @param type
	 * @return
	 */
	public static ReturnDataService getReturnDataService(String type)
	{
		if (returnDataServiceMap.containsKey(type)){
			Class<? extends ReturnDataService> aClass = returnDataServiceMap.get(type);
			return ApplicationContextUtil.getBean(aClass);
		}
		return ApplicationContextUtil.getBean(DefaultRespTransferService.class);
	}
	
}
